import http from "@/api/axios";

export const getListApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/customer/page",
    data
  });
};
// 客户管理 - 获取客户下拉列表可选是否过滤客户子账户
export const getCustomerSelectList = (data: { isFilterChild: number }) => {
  return http({
    method: "post",
    url: "/base/biz/customer/getCustomerSelectList",
    data
  });
};

export const addCustomerApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/customer",
    data
  });
};
export const editCustomerApi = (data: Base.GeneraDataType) => {
  return http({
    method: "put",
    url: "/base/biz/customer",
    data
  });
};
export const disabledCustomerApi = (data: { id: string }) => {
  return http({
    method: "put",
    url: "/base/biz/customer/disabled",
    data
  });
};
export const enabledCustomerApi = (data: { id: string }) => {
  return http({
    method: "put",
    url: "/base/biz/customer/enabled",
    data
  });
};
// 详情
export const getCustomerInfoApi = (data: { id: string }) => {
  return http({
    method: "post",
    url: "/base/biz/customer/details",
    data
  });
};
// 批量修改跟单
export const batchModifyFollwoApi = (data: { userId: string; idList: string[] }) => {
  return http({
    method: "post",
    url: "/base/biz/customer/updateCustomerFollowId",
    data
  });
};
// 批量修改业务员
export const batchModifyBizApi = (data: { userId: string; idList: string[] }) => {
  return http({
    method: "post",
    url: "/base/biz/customer/updateCustomerBizId",
    data
  });
};

//用户管理 - 重置密码
export const resetPasswordApi = (data: { id: string; password: string[] }) => {
  return http({
    method: "post",
    url: "/base/biz/user/rest/pwd",
    data
  });
};

//导出客户信息excel
export const customerExcelApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/export/biz/exportExcel/customerExcel",
    data
  });
};

//重置客户密码
export const restCustomerPasswordApi = (data: { id: string; password: string }) => {
  return http({
    method: "post",
    url: "/base/biz/customer/rest/pwd",
    data
  });
};
